#include <termios.h>
struct Serial_Params
{
        int fd;                 /* File descriptor */
        int comm_port;          /* DOS/Windows COM port number, 1-8 typically */
        int open;		/* flag, TRUE for open FALSE for closed */
        int poll_timeout;       /* Pollng interval in MILLISECONDS */
        int read_wait;          /* time delay between each read */
        int table0_size;	/* Size of VEtable/page_0 datablock */
        int table1_size;	/* Size of VEtable/page_1 datablock */
        int rtvars_size;	/* Size of Realtime vars datablock */
        struct termios oldtio;  /* serial port settings before we touch it */
        struct termios newtio;  /* serial port settings we use when running */
        int errcount;           /* Serial I/O errors read error count */
} serial_params;
void open_serial(int tty_num);
int setup_serial_params();
void close_serial();
	
